package com.zr.gdms.controller;

import java.io.IOException;
import java.io.PrintWriter;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.zr.gdms.service.StudentService;
import com.zr.gdms.serviceimpl.StudentServiceImpl;

/**
 * @author  shichongming
 * @E-mail: 
 * @date 创建时间：2017年5月25日 下午7:52:50 
 * @version 1.0 
 * @parameter  
 * @since  
 * @return  
 */

public class StudnetUpdateControllerSCM extends HttpServlet{
	StudentService stu=new StudentServiceImpl();
	
	@Override
	protected void doGet(HttpServletRequest req, HttpServletResponse resp)
			throws ServletException, IOException {	
		doPost(req, resp);	
	}
	
	
	@Override
	protected void doPost(HttpServletRequest req, HttpServletResponse resp)
			throws ServletException, IOException {
		
		req.setCharacterEncoding("utf-8");
		resp.setCharacterEncoding("utf-8");
		int  sid= Integer.parseInt(req.getParameter("sid"));
		String sname=req.getParameter("sname");
		String sage=req.getParameter("sage");
		String ssex=req.getParameter("ssex");
		String sdepart=req.getParameter("sdepart");
		String stel=req.getParameter("stel");
	PrintWriter pw=resp.getWriter();
	boolean flag=stu.supdateStudentInfo(sid, sname, sage, ssex, sdepart, stel);
		if(flag){
			pw.write("1");
		}else{
			pw.write("0");
		}
		
	}
}
